define(function(){ 
	var data=[
		{
			path:"/index",
			name:"index",
			url:"index"
		},
		{
			path:"/login",
			name:"login",
			url:"login"
		}, 
	];
	var getRoute=function(item){
		return {
			path:item.path,
			name:item.name,
			//递归子路由
			children:item.children?toRoute(item.children):null,
			component:function(fn){ 
				//懒加载文件 
				//"../../js/controller/"	设置默认的加载路径
				require(["../../js/controller/"+item.url],fn);
			}
		}
	}
	var toRoute=function(data){
		var result=[]; 
		if(data){
			for(var i=0;i<data.length;i++){
				result.push(getRoute(data[i]))
			}
		}
		return result;
	}  
	return toRoute(data);
});